var app = getApp();
const pathUrl = app.globalData.pathUrl;
Page({
    data: {
        index:0,
        pathUrl: pathUrl,
        openId: '',
        proNo:'',
        proMark:'',
        checkVal:'',
        bpmStatus:''
    },
    onLoad: function (e) { 
        var openId = wx.getStorageSync('openId');
        var proNo = e.proNo;
        var proName = e.proName;
        var proMark = e.proMark;
        this.setData({
            openId: openId,
            proNo: proNo,
            proMark: proMark,
            bpmStatus: e.bpmStatus
        })
        this.fxjProMainController();
    },
    //产品详情
    fxjProMainController:function(){
        var that = this;
        wx.request({
          url: pathUrl + '/rest/posXjtaskController/list/' + that.data.openId,
            data: {
                pageNumber:1,
                pageSize:10
            },
            success: function (res) {
                if (res.data.ok || res.data.data) {
                    that.setData({
                        list: res.data.data
                    })
                } else {
                    wx.showModal({
                        title: '提示',
                        content: '获取数据失败',
                        confirmColor: '#7aa6d1',
                        showCancel: false
                    })
                }
            }
        })
    },
    // 路由跳转
    goNext: function (e) {
        var that =this;
        var proNo = e.currentTarget.dataset.prono;
        var proMark = e.currentTarget.dataset.promark;
        var checkVal = e.currentTarget.dataset.checkval;
        var bpmStatus = e.currentTarget.dataset.bpmstatus
        if (checkVal){
            wx.navigateTo({
                url: "/pages/applyMortgage/applyMortgage?proNo=" + proNo + '&proMark=' + proMark + '&checkVal=' + checkVal + '&bpmStatus=' + bpmStatus
            })
      }else{
          wx.showModal({
              title: '提示',
              content: '您还没选择选项，请选择',
              confirmColor: '#7aa6d1',
              showCancel: false
          })
      }
        
    },
    goPre:function(){
        wx.navigateBack({
            delta: 1
        })
    },
    radioChange: function (e) {
        var that = this;
        this.setData({
            checkVal: e.detail.value
        });
        console.log(this.data.checkVal)
        
    },
    // 
    goTest:function(e){
      console.info(e.currentTarget.dataset.bpmstatus)
      wx.navigateTo({
        url: "/pages/orderManagementb/orderManagementb?bpmstatus=" + e.currentTarget.dataset.bpmstatus
      })
    },
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {
        this.fxjProMainController();
        wx.stopPullDownRefresh();
    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})